home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / cfir1d.z / cfir1d
Encoding:
Text File  |  2002-10-03  |  25.4 KB  |  463 lines

  1.  
  2.  
  3.  
  4. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CCCCFFFFIIIIRRRR1111DDDD, ZZZZFFFFIIIIRRRR1111DDDD, SSSSFFFFIIIIRRRR1111DDDD, DDDDFFFFIIIIRRRR1111DDDD - Compute the 1D convolution of a sequence
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      Single precision complex
  13.  
  14.           Fortran:
  15.                CCCCAAAALLLLLLLL CCCCFFFFIIIIRRRR1111DDDD ((((_x,,,, _i_n_c_x,,,, _i_x_0,,,, _n_x,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,, _i_n_c_y,,,, _i_y_0,,,,
  16.                _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  17.  
  18.           C/C++:
  19.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  20.                vvvvooooiiiidddd ccccffffiiiirrrr1111dddd(((( ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  21.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,,
  22.                iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  23.                *_b_e_t_a))));;;;
  24.  
  25.           C++ STL:
  26.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  27.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  28.                vvvvooooiiiidddd ccccffffiiiirrrr1111dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  29.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  30.                *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_a_l_p_h_a,,,,
  31.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_b_e_t_a))));;;;
  32.  
  33.      Double precision complex
  34.  
  35.           Fortran:
  36.                CCCCAAAALLLLLLLL ZZZZFFFFIIIIRRRR1111DDDD ((((_x,,,, _i_n_c_x,,,, _i_x_0,,,, _n_x,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,, _i_n_c_y,,,, _i_y_0,,,,
  37.                _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  38.  
  39.           C/C++:
  40.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  41.                vvvvooooiiiidddd zzzzffffiiiirrrr1111dddd(((( ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  42.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,,
  43.                iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  44.                *_b_e_t_a))));;;;
  45.  
  46.           C++ STL:
  47.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  48.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  49.                vvvvooooiiiidddd zzzzffffiiiirrrr1111dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  50.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  51.                *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_a_l_p_h_a,,,,
  52.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_b_e_t_a))));;;;
  53.  
  54.      Single precision
  55.  
  56.           Fortran:
  57.              CCCCAAAALLLLLLLL SSSSFFFFIIIIRRRR1111DDDD ((((_x,,,, _i_n_c_x,,,, _i_x_0,,,, _n_x,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,, _i_n_c_y,,,, _i_y_0,,,,
  58.              _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  71.  
  72.  
  73.  
  74.           C/C++:
  75.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  76.                vvvvooooiiiidddd ssssffffiiiirrrr1111dddd(((( ffffllllooooaaaatttt *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,, ffffllllooooaaaatttt *_h,,,, iiiinnnntttt
  77.                _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ffffllllooooaaaatttt *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,,
  78.                ffffllllooooaaaatttt _a_l_p_h_a,,,, ffffllllooooaaaatttt _b_e_t_a))));;;;
  79.  
  80.      Double precision
  81.  
  82.           Fortran:
  83.              CCCCAAAALLLLLLLL DDDDFFFFIIIIRRRR1111DDDD ((((_x,,,, _i_n_c_x,,,, _i_x_0,,,, _n_x,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,, _i_n_c_y,,,, _i_y_0,,,,
  84.              _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  85.  
  86.           C/C++:
  87.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  88.                vvvvooooiiiidddd ddddffffiiiirrrr1111dddd(((( ddddoooouuuubbbblllleeee *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,, ddddoooouuuubbbblllleeee *_h,,,,
  89.                iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ddddoooouuuubbbblllleeee *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt
  90.                _n_y,,,, ddddoooouuuubbbblllleeee _a_l_p_h_a,,,, ddddoooouuuubbbblllleeee _b_e_t_a))));;;;
  91.  
  92. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  93.      These routines are part of the SCSL Scientific Library and can be loaded
  94.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  95.      directs the linker to use the multi-processor version of the library.
  96.  
  97.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  98.      4 bytes (32 bits). Another version of SCSL is available in which integers
  99.      are 8 bytes (64 bits).  This version allows the user access to larger
  100.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  101.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  102.      only one of the two versions; 4-byte integer and 8-byte integer library
  103.      calls cannot be mixed.
  104.  
  105.      The C and C++ prototypes shown above are appropriate for the 4-byte
  106.      integer version of SCSL. When using the 8-byte integer version, the
  107.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  108.      file should be included.
  109.  
  110. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  111.      These routines compute the convolution of the finite impulse response
  112.      filter _h with a vector _x, producing the output vector _y.
  113.  
  114.           _y = beta * _y + alpha * _h * _x
  115.  
  116.      Suppose _h and _x are two sequences of numbers having _n_h and _n_x elements
  117.      respectively:
  118.  
  119.           h = [h(0), h(1), , h(nh - 1) ] , and
  120.           x = [x(0), x(1), , x(nx - 1) ] .
  121.  
  122.  
  123.      The convolution product, _y = _h****_x, is the sequence that has _n_h + _n_x - 1
  124.      non-zero elements defined by the following:
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  137.  
  138.  
  139.  
  140.                  nh-1
  141.           y(j) = Sum [h(k)x(j-k)] for j=0, ...,nx+nh-2
  142.                  j=0
  143.  
  144.  
  145.      y(0) = h(0)*x(0)
  146.      y(1) = h(0)*x(1) + h(1)*x(0)
  147.      y(2) = h(0)*x(2) + h(1)*x(1) + h(2)*x(0)
  148.  
  149.      y(nh-1) = h(0)*x(nh-1) + h(1)*x(nh-2) + ... + h(nh-1)*x(0)
  150.                                       ...
  151.      y(j) = h(0)*x(j) + h(1)*x(j-1) + ... + h(nh-1)*x(j-nh+1)
  152.                                       ...
  153.      y(nx-1) = h(0)*x(nx-1) + h(1)*x(nx-2) + ... + h(nh-1)*x(nx-nh)
  154.                                       ...
  155.      y(nx+nh-3) = h(nh-2)*x(nx-1) + h(nh-1)*x(nx-2)
  156.      y(nx+nh-2) = h(nh-1)*x(nx-1)
  157.  
  158.  
  159.      In the ****FFFFIIIIRRRR1111DDDD routines, the number of terms in the output sequence is
  160.      specified by an argument, _n_y.  If _n_y < _n_h + _n_x - 1 the sequence _y is
  161.      truncated.  If _n_y > _n_h + _n_x - 1 the terms beyond _y(_n_h + _n_x - 2) are set
  162.      to 0.
  163.  
  164.      Generally, the sequences _x, _h and _y represent signals sampled at equal
  165.      time intervals, and the indexes of the vectors denote the sample times.
  166.      If all three signals begin at the same time, we may, without loss of
  167.      generality, set the initial time to 0, as in the formulas above.
  168.  
  169.      The ****FFFFIIIIRRRR1111DDDD routines, however, permit more generality than this. The
  170.      signals may be time shifted from each other using input parameters
  171.      specifiying the initial time sample for each signal. This can be useful
  172.      in several situations. For example, if the input array has several
  173.      leading zero values that one does not wish to store, iiiixxxx0000 may be set to
  174.      the time sample corresponding to the first non-zero element in the input
  175.      array, and earlier time samples are treated as 0. Another use is to limit
  176.      the output to just the "fully engaged" terms of the convolution.
  177.  
  178.      As can be seen above, when _n_x>= _n_h, the convolution has ramp-up and
  179.      ramp-down regions in which fewer than all _n_h filter values contribute to
  180.      the output value. Setting iiiiyyyy0000 to _n_h-1 causes the first value output to
  181.      correspond to time sample _n_h-1, thus skipping the ramp-up region.
  182.      Setting _n_y to _n_x-_n_h+1 then drops the ramp-down terms, limiting the output
  183.      to just the fully engaged part.
  184.  
  185.      Note that, instead of 0, the initial time could just as easily have been
  186.      labeled 1 or 10 or -78; the relevant point is that the first elements of
  187.      each of the _x, _h and _y arrays are defined to be the same time sample as
  188.      long as iiiixxxx0000 ==== iiiihhhh0000 ==== iiiiyyyy0000.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      See the NOTES section of this man page for information about the
  207.      interpretation of the data types described in the following arguments.
  208.  
  209.      These routines have the following arguments:
  210.  
  211.      _x         Array of dimension _n_x. (input).
  212.                CCCCFFFFIIIIRRRR1111DDDD: Single precision complex array.
  213.                ZZZZFFFFIIIIRRRR1111DDDD: Double precision complex array.
  214.                SSSSFFFFIIIIRRRR1111DDDD: Single precision array.
  215.                DDDDFFFFIIIIRRRR1111DDDD: Double precision array.
  216.                Input sequences to be convolved with _h.
  217.  
  218.      _i_n_c_x      Integer. (input)
  219.                The increment between two successive values of _x.  _i_n_c_x must
  220.                not be 0.
  221.  
  222.      _i_x_0       Integer. (input)
  223.                Time sample corresponding to the first element of _x.
  224.  
  225.      _n_x        Integer. (input)
  226.                The number of elements in the sequence _x.  _n_x >= 0.
  227.  
  228.      _h         Array of dimension _n_h. (input).
  229.                CCCCFFFFIIIIRRRR1111DDDD: Single precision complex array.
  230.                ZZZZFFFFIIIIRRRR1111DDDD: Double precision complex array.
  231.                SSSSFFFFIIIIRRRR1111DDDD: Single precision array.
  232.                DDDDFFFFIIIIRRRR1111DDDD: Double precision array.
  233.                Input sequence to be convolved with _x.
  234.  
  235.      _i_n_c_h      Integer.  (input)
  236.                Increment between two successive values of _h. _i_n_c_h must not be
  237.                0.
  238.  
  239.      _i_h_0       Integer.  (input)
  240.                Time sample corresponding to the first element of _h.
  241.  
  242.      _n_h        Integer.  (input)
  243.                The number of elements in the sequence _h.  _n_h >= 0.
  244.  
  245.      _y         Array of dimension _n_y.  (input and output).
  246.                CCCCFFFFIIIIRRRR1111DDDD: Single precision complex array.
  247.                ZZZZFFFFIIIIRRRR1111DDDD: Double precision complex array.
  248.                SSSSFFFFIIIIRRRR1111DDDD: Single precision array.
  249.                DDDDFFFFIIIIRRRR1111DDDD: Double precision array.
  250.                Output of the FIR filter.  On entry, the array _y must have been
  251.                initialized, except except when beta is 0; in that case, _y need
  252.                not be initialized.  On exit, the result overwrites _y.
  253.  
  254.      _i_n_c_y      Integer.  (input)
  255.                Increment between two successive values of _y.  _i_n_c_y must not be
  256.                0.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      _i_y_0       Integer.  (input)
  273.                Time sample corresponding to the first element of _y.
  274.  
  275.      _n_y        Integer.  (input)
  276.                Number of elements in the sequence _y.  _n_y >= 0.
  277.  
  278.      _a_l_p_h_a     Scale factor for the convolution.  (input).
  279.                CCCCFFFFIIIIRRRR1111DDDD: Single precision complex.
  280.                ZZZZFFFFIIIIRRRR1111DDDD: Double precision complex.
  281.                SSSSFFFFIIIIRRRR1111DDDD: Single precision.
  282.                DDDDFFFFIIIIRRRR1111DDDD: Double precision.
  283.                For C/C++, a pointer to this value is passed.
  284.  
  285.      _b_e_t_a      Scale factor for the output _y. (input)
  286.                CCCCFFFFIIIIRRRR1111DDDD: Single precision complex.
  287.                ZZZZFFFFIIIIRRRR1111DDDD: Double precision complex.
  288.                SSSSFFFFIIIIRRRR1111DDDD: Single precision.
  289.                DDDDFFFFIIIIRRRR1111DDDD: Double precision.
  290.                When _b_e_t_a is supplied as 0, _y need not be set on input.  For
  291.                C/C++, a pointer to this value is passed.
  292.  
  293. NNNNOOOOTTTTEEEESSSS
  294.      The following data types are described in this documentation:
  295.  
  296.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  297.  
  298.      Fortran:
  299.  
  300.           Array dimensioned 0000........_n----1111      xxxx((((0000::::nnnn----1111))))
  301.  
  302.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  303.  
  304.           Array of dimensions (_m,_n,_p)   xxxx((((mmmm,,,,nnnn,,,,pppp))))
  305.  
  306.           IIIInnnntttteeeeggggeeeerrrr                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  307.  
  308.           Single precision              RRRREEEEAAAALLLL
  309.  
  310.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  311.  
  312.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  313.  
  314.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  315.  
  316.      C/C++:
  317.  
  318.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  319.  
  320.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  335.  
  336.  
  337.  
  338.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  339.  
  340.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  341.  
  342.           Single precision              ffffllllooooaaaatttt
  343.  
  344.           Double precision              ddddoooouuuubbbblllleeee
  345.  
  346.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  347.  
  348.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  349.  
  350.      C++ STL:
  351.  
  352.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  353.  
  354.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  355.  
  356.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  357.  
  358.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  359.  
  360.           Single precision              ffffllllooooaaaatttt
  361.  
  362.           Double precision              ddddoooouuuubbbblllleeee
  363.  
  364.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  365.  
  366.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  367.  
  368. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  369.      The arrays _x, _h, and _y must be non-overlapping.
  370.  
  371. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  372.      The following example computes the convolution of a 4-sample sequence _x
  373.      with a filter _h containing 3 samples.
  374.  
  375.      Fortran:
  376.  
  377.            REAL X(0:3), H(0:2), Y(0:5)
  378.            REAL ALPHA, BETA
  379.            ALPHA = 1.0
  380.            BETA  = 0.0
  381.  
  382.            X(0) = 1.0
  383.            DO I = 1, 3
  384.              X(I) = -1.0
  385.            ENDDO
  386.            DO I = 0, 2
  387.               H(I) = 1.0/(I+1)
  388.            ENDDO
  389.            CALL SFIR1D(X(0), 1, 0, 4, H(0), 1, 0, 3, Y(0), 1, 0, 6,
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR1111DDDD((((3333SSSS))))
  401.  
  402.  
  403.  
  404.           &            ALPHA, BETA)
  405.  
  406.  
  407.      C/C++:
  408.  
  409.           #include <scsl_fft.h>
  410.           float x[4], h[3], y[6];
  411.           float alpha = 1.0f;
  412.           float beta  = 0.0f;
  413.           int i;
  414.  
  415.           x[0] = 1.0f
  416.           for (i=1; i<4; i++) {
  417.                x[i] = -1.0f;
  418.           }
  419.           for (i=0; i<3; i++) {
  420.               h[i] = 1.0f/(i+1);
  421.           }
  422.           sfir1d(x, 1, 0, 4, h, 1, 0, 3, y, 1, 0, 6, alpha, beta);
  423.  
  424.  
  425.      The output is the following:
  426.  
  427.                         Y(0)     Y(1)     Y(2)     Y(3)     Y(4)     Y(5)
  428.                       1.0000  -0.5000  -1.1667  -1.8333  -0.8333  -0.3333
  429.  
  430.  
  431.      Changing the values for iiiixxxx0000, iiiihhhh0000 and iiiiyyyy0000 produces the following shifts in
  432.      the output:
  433.  
  434.                         Y(0)     Y(1)     Y(2)     Y(3)     Y(4)     Y(5)
  435.           ix0 = +1:   0.0000   1.0000  -0.5000  -1.1667  -1.8333  -0.8333
  436.           ix0 = +2:   0.0000   0.0000   1.0000  -0.5000  -1.1667  -1.8333
  437.           ix0 = -1:  -0.5000  -1.1667  -1.8333  -0.8333  -0.3333   0.0000
  438.           ix0 = -2:  -1.1667  -1.8333  -0.8333  -0.3333   0.0000   0.0000
  439.           ih0 = +1:   0.0000   1.0000  -0.5000  -1.1667  -1.8333  -0.8333
  440.           ih0 = +2:   0.0000   0.0000   1.0000  -0.5000  -1.1667  -1.8333
  441.           ih0 = -1:  -0.5000  -1.1667  -1.8333  -0.8333  -0.3333   0.0000
  442.           ih0 = -2:  -1.1667  -1.8333  -0.8333  -0.3333   0.0000   0.0000
  443.           iy0 = +1:  -0.5000  -1.1667  -1.8333  -0.8333  -0.3333   0.0000
  444.           iy0 = +2:  -1.1667  -1.8333  -0.8333  -0.3333   0.0000   0.0000
  445.           iy0 = -1:   0.0000   1.0000  -0.5000  -1.1667  -1.8333  -0.8333
  446.           iy0 = -2:   0.0000   0.0000   1.0000  -0.5000  -1.1667  -1.8333
  447.  
  448.  
  449. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  450.      IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S)
  451.  
  452.  
  453.  
  454.  
  455.  
  456.                                                                         PPPPaaaaggggeeee 7777
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.